package com.keon.jianbao.enu;

import com.keon.jianbao.R;
import com.keon.jianbao.ui.fragment.SecretaryListFragment;
import com.keon.jianbao.ui.gridviewfragment.ExpertChooseListFragment;
import com.keon.jianbao.ui.fragment.MessageListFragment;
import com.keon.jianbao.ui.gridviewfragment.ExpertListFragment;
import com.keon.jianbao.ui.viewpagerfragment.JianBaoViewPagerFragment;
import com.keon.jianbao.ui.viewpagerfragment.OrderViewPagerFragment;
import com.keon.jianbao.ui.viewpagerfragment.ReviewViewPagerFragment;

/**
 * Created by keon on 2015/9/8.
 */
public enum ListType {
    MESSAGELIST(0, R.string.message, MessageListFragment.class),
    REVIEWLIST(1, R.string.review, ReviewViewPagerFragment.class),
    ORDERLIST(2, R.string.order, OrderViewPagerFragment.class),
    JIANBAOLIST(3, R.string.jianbao, JianBaoViewPagerFragment.class),
    EXPERTGRIDLIST(4, R.string.expert_choose, ExpertChooseListFragment.class),
    EXPERTGRIDLIST2(5, R.string.expert, ExpertListFragment.class),
    SECRETARYLIST(6, R.string.secretary, SecretaryListFragment.class);

    private int id;
    private int title;
    private Class<?> clz;

    private ListType(int id, int title, Class<?> clz) {
        this.id = id;
        this.title = title;
        this.clz = clz;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public static ListType getList(int id) {
        for (ListType c : ListType.values()) {
            if (c.getId() == id) {
                return c;
            }
        }
        return null;
    }
}
